package day09;

import javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec;

public class NumberPrc01 {
    public static void main(String[] args) {
//        testInt();
//        testDou();
        boxTest();
    }

    private static void boxTest() {
        Integer i1=Integer.valueOf(127);
        Integer i2=127;//自动装箱
        int i3=i1;//自动拆箱
    }

    private static void testInt() {
        Integer i=new Integer(15);
        Integer i1=Integer.valueOf(15);
        Integer i2=Integer.valueOf(15);
        System.out.println(i1==i2);
        System.out.println("************");
        String s0="abc";
        String s1=new String("abc");
        String s2=String.valueOf("abc");
        String s3=String.valueOf("abc");
        System.out.println(s3==s2);
        System.out.println("**************");
        System.out.println(i.hashCode());
        System.out.println(i1.hashCode());
        System.out.println(i==i1);//false
        System.out.println(i.equals(i1));//true
    }

    private static void testDou() {
        Double d1=Double.valueOf(3.14);
        Double d2=new Double(3.14);
        System.out.println(d1==d2);
        System.out.println(d1.equals(d2));
    }
}
